﻿@{
    ViewBag.Title = "Vendor_Sum";
}
@using JustMVCTest.Models;
@using System.Collections.Generic;
@model JustMVCTest.Controllers.ReportController.Main_Vendor_Sum
           
<br />
<head>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
</head>

<body>

Total PO's: @Model.HeadLine.CountPos


<div id="replogo">
@{
  var RelPathS = System.Configuration.ConfigurationManager.AppSettings["WebDirectory"].ToString();
  var RelPathE = "/JustMVCTest/pics/report.jpg";
  var RelPath = RelPathS + RelPathE;
}
<img src= "@RelPath" alt="Reportlogo" align="left" />
</div>

<table cellpadding="3" cellspacing="3">
    <tr border="1" bgcolor="#87CEFF" color="#ffffff">
        <td width="30%" align="center">
            Open Amount Left
        </td>
        <td width="10%" align="center">
            Total PO's
        </td>
        <td width="60%" align="center">
            Vendor Name
        </td>
    </tr>
    @{
        var OddColor = "#DDEEEE";
        var evenColor = "#EEFFFF";
        var Odd = OddColor;
    }
    @{ 
        var num_rows = 1;
        var first_time = true;
        
    }
    @foreach (JustMVCTest.Controllers.ReportController.Vendor_Sum po in Model.Vendor_Sum)
    {
        if (num_rows % 18 == 0 && !first_time)
        {
             <tr border="1" bgcolor="#87CEFF" color="#ffffff">
                <td width="30%" align="center">
                    Open Amount Left
                </td>
                <td width="10%" align="center">
                    Total PO's
                </td>
                <td width="60%" align="center">
                    Vendor Name
                </td>
            </tr>
        }
        else
        {
            <tr border="1" align="center" bgcolor="@Odd">
                <td>@po.Open_Amt_L_Sum$
                </td>
                <td>@po.Count
                </td>
                <td>@po.VendorName
                </td>
            </tr>
        }
        num_rows++;
        first_time = false;
        if (Odd == OddColor)
        {
            Odd = evenColor;
        }
        else
        {
            Odd = OddColor;
        }

    }
</table>

</body>
